import type { BatchMaterialLoadingModel } from './models';

import { requestClient } from '#/api/request';

/**
 * 分页查询批次料上料数据集合
 * @param params 分页查询参数
 * @returns 返回查询结果
 */
export async function getBatchMaterialLoadingPagedListApi(params?: PageParams) {
  return requestClient.get<PaginationResult<BatchMaterialLoadingModel>>(
    '/mes/production/batchMaterialLoading/list-page',
    {
      params,
    },
  );
}

/**
 * 下料批次料
 * @param id 上料记录 Id
 * @returns 返回结果
 */
export async function unloadBatchMaterialLoadingApi(id: number) {
  return requestClient.put<boolean>(
    `/mes/production/batchMaterialLoading/unload`,
    {
      id,
    },
  );
}
